using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BlogEngine.Core.Providers;
using BlogEngine.Core;

public partial class admin_viewalbums : System.Web.UI.Page
{
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!Page.IsPostBack)
		{
			if (Request.QueryString["Action"] != null)
			{
				string action = Request.QueryString["Action"];
				Album album = Album.GetById(new Guid(Request.QueryString["AlbumId"]));

				switch (action.ToLower())
				{
					case "top": Album.MoveFirst(album); break;
					case "up": Album.MoveUp(album); break;
					case "down": Album.MoveDown(album); break;
					case "bottom": Album.MoveLast(album); break;
					default: break;
				}

				Response.Redirect("ViewAlbums.aspx");
			}
			else
				BindAlbums();
		}

		Page.Title = Resources.labels.photos;
	}

	#region Event Handlers

	#endregion

	#region Data Binding

	private void BindAlbums()
	{
		AlbumContent.DataSource = Album.Items;
		AlbumContent.DataBind();
	}

	#endregion

}
